package com.itheima.reflect;

import java.lang.reflect.Field;

public class MyReflectDemo {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException {
        //提取字节码文件的对象
        Class<?> clazz = Class.forName("com.itheima.reflect.Student");
        //进行遍历
//        Field[] fields = clazz.getDeclaredFields();
//
//        for (Field field : fields) {
//            System.out.println(field);
//        }

        //获取单个的成员变量
        Field gender = clazz.getDeclaredField("name");
        System.out.println(gender);
    }
}
